package threadDemo;

public class Test02  {
    public static void main(String[] args)
    {
        try
        {
            MyThread01 thread=new MyThread01();
            thread.setName("myThread");
            thread.start();
            for (int i=0;i<10;i++)
            {
                int time=(int)(Math.random()*1000);
                Thread.sleep(time);
                System.out.println("主线程名称="+Thread.currentThread().getName());
            }
        }
        catch(InterruptedException e)
        {
            e.printStackTrace();
        }
    }
}
